package com.ruoyi.faq.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.faq.mapper.FaqKnowledgeMapper;
import com.ruoyi.faq.domain.FaqKnowledge;
import com.ruoyi.faq.service.IFaqKnowledgeService;

/**
 * FAQ知识库Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-13
 */
@Service
public class FaqKnowledgeServiceImpl implements IFaqKnowledgeService 
{
    @Autowired
    private FaqKnowledgeMapper faqKnowledgeMapper;

    /**
     * 查询FAQ知识库
     * 
     * @param id FAQ知识库主键
     * @return FAQ知识库
     */
    @Override
    public FaqKnowledge selectFaqKnowledgeById(Long id)
    {
        return faqKnowledgeMapper.selectFaqKnowledgeById(id);
    }

    /**
     * 查询FAQ知识库列表
     * 
     * @param faqKnowledge FAQ知识库
     * @return FAQ知识库
     */
    @Override
    public List<FaqKnowledge> selectFaqKnowledgeList(FaqKnowledge faqKnowledge)
    {
        return faqKnowledgeMapper.selectFaqKnowledgeList(faqKnowledge);
    }

    /**
     * 新增FAQ知识库
     * 
     * @param faqKnowledge FAQ知识库
     * @return 结果
     */
    @Override
    public int insertFaqKnowledge(FaqKnowledge faqKnowledge)
    {
        faqKnowledge.setCreateTime(DateUtils.getNowDate());
        return faqKnowledgeMapper.insertFaqKnowledge(faqKnowledge);
    }

    /**
     * 修改FAQ知识库
     * 
     * @param faqKnowledge FAQ知识库
     * @return 结果
     */
    @Override
    public int updateFaqKnowledge(FaqKnowledge faqKnowledge)
    {
        faqKnowledge.setUpdateTime(DateUtils.getNowDate());
        return faqKnowledgeMapper.updateFaqKnowledge(faqKnowledge);
    }

    /**
     * 批量删除FAQ知识库
     * 
     * @param ids 需要删除的FAQ知识库主键
     * @return 结果
     */
    @Override
    public int deleteFaqKnowledgeByIds(Long[] ids)
    {
        return faqKnowledgeMapper.deleteFaqKnowledgeByIds(ids);
    }

    /**
     * 删除FAQ知识库信息
     * 
     * @param id FAQ知识库主键
     * @return 结果
     */
    @Override
    public int deleteFaqKnowledgeById(Long id)
    {
        return faqKnowledgeMapper.deleteFaqKnowledgeById(id);
    }
}
